HTML DOM Link rel Property

# Link rel Property

Link Object

## Example

Return the relationship between the current document and the linked document:

var x = document.getElementById("myLink").rel;

The result of x will be:

stylesheet
Try it yourself »

## Definition and Usage

The rel property sets or returns a space-separated list that defines the relationship between the current document and the linked document.

## Browser Support

The rel property is supported in all major browsers.

Note: The value "search" is not supported in Opera or Safari.

Note: The value "sidebar" is not supported in IE, Safari, or Chrome.

## Syntax

Return the rel property:

linkObject.rel

Set the rel property:

linkObject.rel=relationship

## Property Values

Value | Description
--- | ---
alternate | Linked page is an alternative version of the current document
appendix | Linked page is the appendix page for the current document
chapter | Refers to a chapter
contents | Linked page is the table of contents for the current document
copyright | Linked page is the copyright/policy for the current document
glossary | Linked page is the glossary page for the current document
help | Linked page is the help page for the current document
index | Linked page is the index page for the current document
next | Refers to the next page
offline | Refers to a location that contains a path to the CDF file
prev | Refers to the previous page
search | Refers to an XML file in OpenSearch description format
section | Link to a section in a list of documents
shortcut icon | Refers to an icon location
sidebar | Refers to the bookmark panel
start | Refers to the first page (used by search engines to show the first page)
stylesheet | Linked page is the style sheet for the current document
subsection | Linked page is a subsection for the current document

## Technical Details

Return Value: | A String, representing a space-separated list of relationship types

## Related Pages

HTML reference: HTML <link> rel attribute

Link Object

### WEB HOSTING

UK Reseller Hosting

### WEB BUILDING

FREE Website BUILDER Free HTML5 Templates

### W3SCHOOLS EXAMS

HTML, CSS, JavaScript, PHP, jQuery, XML, and ASP Certifications

### SHARE THIS PAGE

### Color Picker

### HTML/CSS

HTML Tutorial HTML5 Tutorial CSS Tutorial CSS3 Tutorial Bootstrap Tutorial

### JavaScript

JavaScript Tutorial jQuery Tutorial jQuery Mobile Tutorial AngularJS Tutorial AJAX Tutorial JSON Tutorial

### Graphics

Canvas Tutorial SVG Tutorial Google Maps Tutorial

### Server Side

SQL Tutorial PHP Tutorial ASP Tutorial ASP.NET Tutorial VBScript Tutorial AppML Tutorial

### Web

Web Building Web Statistics Web Certification

### XML

XML Tutorial DTD Tutorial Schema Tutorial XML DOM Tutorial XPath Tutorial XSLT Tutorial XQuery Tutorial XSL-FO Tutorial RSS Tutorial WSDL Tutorial

### HTML/CSS

HTML Tag Reference HTML Event Reference HTML Color Reference CSS 1,2,3 Reference Bootstrap Reference

### JavaScript

JavaScript Reference HTML DOM Reference jQuery Reference jQuery Mobile Reference Google Maps Reference

### Server Side

PHP Reference SQL Reference ASP Reference VBScript Reference Razor Reference ASP.NET Reference

### XML

XML DOM Reference XSLT Reference XSL-FO Reference XPath Reference XQuery Reference Schema Reference RSS Reference SVG Reference

### HTML Charsets

HTML Character Sets HTML ASCII HTML ANSI HTML Windows-1252 HTML ISO-8859-1 HTML Symbols HTML UTF-8

### HTML/CSS

HTML Examples CSS Examples

### Browser Scripting

JavaScript Examples HTML DOM Examples jQuery Examples jQuery Mobile Examples AngularJS Examples AJAX Examples

### Server Scripting

PHP Examples ASP Examples VBScript Examples Razor Examples .NET Examples

### XML Languages

XML Examples DTD Examples XML DOM Examples XSL Examples XSLT Examples XPath Examples XQuery Examples Schema Examples RSS Examples SVG Examples